var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("fsm"),
    i = t("GameData"),
    s = t("ConfS"),
    c = t("fightManager"),
    l = t("fun"),
    u = t("Load"),
    p = t("AIdelay"),
    f = t("body"),
    d = cc._decorator,
    h = d.ccclass,
    y =
        (d.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.get_all_enemys = function () {
                    return c.default.inst.enemy.enemys;
                }),
                (e.prototype.is_player = function () {
                    return !0;
                }),
                (e.prototype.on_skill = function (t) {
                    var e = this.skill.get_skill(t);
                    e.is_ready() && e.is_nengliang(this) && this.state.on_skill(e);
                }),
                (e.prototype.get_buff_data = function (t, e) {
                    var o = i.default.skillLvs[t];
                    null == o && (o = 1);
                    var n = 100 * (t - 101e6) + o + 1e8;
                    return s.DatasManager.BuffDatasById[n];
                }),
                (e.prototype.on_attack = function () {
                    if (this.skill.is_pugong_ready()) {
                        var t = this.skill.get_random_pugong();
                        this.state.on_skill(t);
                    }
                }),
                (e.prototype.onEnable = function () {
                    this.data = s.DatasManager.HeroDatasById[i.default.herohelp];
                    var t = l.getHeroLv(this.data.ID, i.default.herolvs),
                        e = 124e6 + 1e3 * (this.data.ID - 112e6) + t;
                    (this.infodata = s.DatasManager.UpgradeDatasById[e]),
                        (this.pars = l.getEquipsPars(this.data, i.default.equips)),
                        (this.maxhp.value = this.infodata.hp + this.pars.h),
                        (this.hp.value = this.maxhp.value),
                        (this.maxmp.value = 100),
                        (this.mp.value = 100);
                    var o = this.node.getChildByName("sk").getComponent(sp.Skeleton);
                    (o.skeletonData = u.default.skeletonDatas[this.data.spinePath]),
                        l.showEquips(o, this.data, i.default.equips);
                    var n = c.default.inst.player;
                    (this.node.x = n.node.x), (this.node.y = n.node.y);
                    var r = this.node.getComponent(cc.PhysicsBoxCollider);
                    (r.size = cc.size(this.data.zishen[0], this.data.zishen[1])),
                        r.apply(),
                        (this.node.getComponent(cc.BoxCollider).size = cc.size(
                            this.data.zishenhit[0],
                            this.data.zishenhit[1]
                        )),
                        a.changeState(this, p.default);
                }),
                (e.prototype.update = function (t) {
                    this.state.onUpdate(t);
                }),
                (e = r([h], e))
            );
        })(f.default));
o.default = y;
